package common;

public class LoginMessage extends Message<User> {
    /**
     * 
     */
    private static final long serialVersionUID = 6328469719415393097L;

    public LoginMessage(String n, String h, int p, Boolean s, Capabilities[] c) {
        super("LOGIN", new User(n, h, p, s, c));
    }

    public String toString() {
        String result ="_LOGIN_\n" + super.getContent().getName() + "\n"
                + super.getContent().getClientAddr() + "\n"
                + super.getContent().getClientPort() + "\n"
                + super.getContent().getOnline() + "\n";
        for(Capabilities cap: super.getContent().getCapabilities())
            result += cap.toString() + "\n"; 
        return result+ "_END_";
    }
}
